﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace N01
{

    // 底层模块
    public class ChineseSong
    {
        public string GetSongWords()
        {
            return "中文歌";
        }

    }
    // 底层模块
    public class EnglishSong
    {
        public string GetEnglishWords()
        {
            return "English";
        }
    }

    // 高层模块：过度依赖了底层模块，不符合 依赖倒置原则=》开放封闭原则=》单一职责原则=》高内聚低耦合
    public class Singer
    {
        public void SingSong(ChineseSong chineseSong)
        {
            Console.WriteLine("唱" + chineseSong.GetSongWords());
        }

        public void SingEnglish(EnglishSong englishSong)
        {
            Console.WriteLine("唱" + englishSong.GetEnglishWords());
        }

    }



}
 